<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCardsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cards', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->default('')->comment('标题');
            $table->decimal('price')->default(0.00)->comment('购买价格');
            $table->integer('number')->default('0')->comment('洗车次数');
            $table->integer('days')->default('0')->comment('洗车有效天数');
            $table->tinyInteger('range')->default('0')->comment('使用限制:0=全场通用,1=指定服务');
            $table->integer('shop_id')->default('0')->comment('门店ID');
            $table->json('services')->nullable()->comment('服务适应组');
            $table->float('discount')->default(0.00)->comment('折扣');
            $table->text('content')->nullable()->comment('权益说明');
            $table->json('rates')->nullable()->comment('分成比例');
            $table->text('content')->nullable()->comment('权益说明');
            $table->tinyInteger('status')->default('0')->comment('状态:0=正常,1=隐藏');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cards');
    }
}
